using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using ALinq.BBS.Common.Config;

namespace ALinq.BBS.Common.Config
{
    public class PostTypeElement : ConfigurationElement
    {
        [ConfigurationProperty("id")]
        public int ID
        {
            get { return (int) base["id"]; }
            set { base["id"] = value; }
        }

        [ConfigurationProperty("name")]
        public string Name
        {
            get { return (string) base["name"]; }
            set { base["name"] = value; }
        }

        [ConfigurationProperty("editor")]
        public string EditorPath
        {
            get { return (string) base["editor"]; }
        }

        [ConfigurationProperty("viewer")]
        public string ViewerPath
        {
            get { return (string) base["viewer"]; }
        }

        [ConfigurationProperty("seter")]
        public string SettingerPath
        {
            get { return (string) base["settinger"]; }
        }
    }

    public class PostTypeElementCollection : ConfigurationElementCollection<PostTypeElement>
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new PostTypeElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((PostTypeElement)element).ID;
        }
    }
}